package part07_组合模式_学校院系展示;

/**
 * @ClassName: OrganizationComponent
 * @Author: AllenSun
 * @Date: 2020/3/2 19:38
 */
public abstract class OrganizationComponent {
    //属性
    private String name;
    private String des;

    /**添加方法
     * @MethodName: add
     * @Author: AllenSun
     * @Date: 2020/3/2 21:13
     */
    protected void add(OrganizationComponent organizationComponent){
        //默认实现
        throw new UnsupportedOperationException();
    }

    /**抽象方法--打印
     * @MethodName: print
     * @Author: AllenSun
     * @Date: 2020/3/2 21:13
     */
    protected abstract void print();

    /**移除方法
     * @MethodName: remove
     * @Author: AllenSun
     * @Date: 2020/3/2 21:13
     */
    protected void remove(OrganizationComponent organizationComponent){
        throw new UnsupportedOperationException();
    }

    //构造器
    public OrganizationComponent(String name, String des){
        super();
        this.name=name;
        this.des=des;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDes() {
        return des;
    }

    public void setDes(String des) {
        this.des = des;
    }
}
